<template>
  <el-drawer v-model="props.visible" title="流程审批" direction="ltr" size="50%">
    <ProcessWorkTask :task-id="worktaskId" />
  </el-drawer>
</template>

<script setup>
import { defineProps,defineModel, watch,ref, nextTick } from "vue";
import ProcessWorkTask from "@/components/WorkflowDesign/FlowProcesses/ProcessWorkTask.vue";
const props = defineProps({
  taskId: {
    default: "",
  },
  visible: {
    default: true,
  },
});
defineEmits(['update:visible']);
const worktaskId = ref("");
watch(
  () => props.visible,
  () => {
    if (!props.visible) {
        worktaskId.value = "";
    }
  }
);

watch(
  () => props.taskId,
  async () => {
    await nextTick();
    if (props.taskId && props.taskId.length > 0) {
      worktaskId.value = props.taskId;
    }
  }
);
</script>

<style></style>
